from flask import Flask,url_for

app = Flask(__name__)
# 配置文件
app.config.from_object('settings.DevelopmentConfig')


@app.route('/index', methods=['GET','POST'], endpoint="n1")
def index():
    v1 = url_for('n1')
    v2 = url_for("n2")
    v3 = url_for('n3')
    print(v1)
    print(v2)
    print(v3)
    return 'Index'

@app.route('/login', methods=['GET','POST'],endpoint='n2')
def login():
    return 'login'

@app.route('/logout', methods=['GET','POST'], endpoint="n3")
def logout():
    return 'logout'


if __name__ == '__main__':
    app.run()

"""
url_for
反向生成url: 1.endpoint="别名"
             2. url_for("n1")          
"""